import React, {useEffect, useState} from 'react';
import Util from '../../assets/js/util';
import PieMap from './component/pie-map/pieMap';
import RoadMap from './component/road-map/canvas-card';
import { Tabs } from 'antd';
import BingDwenDwen from './component/Bingdwendwen-map/bingdwendwen';

const { TabPane } = Tabs;
export default function Canvas() {
  const [date, setDate] = useState<Date>(new Date());
  useEffect(() => {
    Util.resetPc();
    setInterval(() => {
      setDate(new Date());
    }, 1000);
  }, []);

  function callback(key: any) {
    console.log(key);
  }

  return (
    <div>
      <div>
        {Util.format(date, 'yyyy-MM-dd HH:mm:ss')}
        <Tabs defaultActiveKey="1" onChange={callback}>
    <TabPane tab="Tab 1" key="1">
      <BingDwenDwen></BingDwenDwen>
    </TabPane>
    <TabPane tab="饼图和闭环" key="2">
    <PieMap></PieMap>
    </TabPane>
    <TabPane tab="点击现鱼钩" key="3">
      <RoadMap></RoadMap>
    </TabPane>
  </Tabs>
      </div>
    </div>
  );
}
